<template>
  <img :src="url" alt="" class="back" @mouseover="mouseover" @mouseleave="mouseleave" @click="navigatorTo">
</template>

<script>
export default {
  name: 'Back',
  data() {
    return {
      url: require('../../assets/task/back.png'),
    };
  },
  methods: {
    navigatorTo() {
      let back = this.$route.query.back;
      back?location.href = back:location.href = '/#/';
    },
    mouseover() {
      this.url = require('../../assets/task/back_hover.png');
    },
    mouseleave() {
      this.url = require('../../assets/task/back.png');
    },
  },
};
</script>

<style scoped>
.back {
  width: 7.5vw;
  cursor: pointer;
}
</style>
